<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/28
 * Time: 17:57
 */

namespace app\api\controller\v1;
use app\api\model\Category as CategoryModel;
use app\lib\Exception\CategoryException;

class Category
{
    public function getCategoryList(){
        $category = CategoryModel::with('image')->select();
        if ($category->isEmpty()){
            throw new CategoryException();
        }
        return $category;
    }
}